package com.example.financeiro;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Cadastro extends Activity implements OnClickListener {
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	try {
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.cadastro);
    		
            Button btCadastroGravar = (Button) findViewById(R.id.btCadastroGravar);
            btCadastroGravar.setOnClickListener(this);
            
            btCadastroGravar.setOnClickListener(new OnClickListener() {
                public void onClick(View v) {
                	Intent i = new Intent(Cadastro.this, Login.class);
            		startActivity(i);
            	}
        	});
            
            Button btCadastroCancelar = (Button) findViewById(R.id.btCadastroCancelar);
            btCadastroCancelar.setOnClickListener(this);
            
            btCadastroCancelar.setOnClickListener(new OnClickListener() {
                public void onClick(View v) {
                	Intent i = new Intent(Cadastro.this, Login.class);
            		startActivity(i);
            	}
        	});
    		
    	}catch(Exception e) {
    		AlertMensagem("erro", e.getMessage());
    	}
    }
    
	 public void AlertMensagem (String Titulo, String Mensagem) {
		 AlertDialog.Builder alert = new AlertDialog.Builder(Cadastro.this);
		 alert.setTitle(Titulo);
		 alert.setMessage(Mensagem);
		 alert.setNeutralButton("OK", null);
		 alert.show();
	 }

	public void onClick(View v) {
		// TODO Auto-generated method stub
	}
}
